// SPDX-FileCopyrightText: 2023-2025 Sangfor Technologies Inc.
// SPDX-License-Identifier: Mulan PSL v2
package validate

import (
	"testing"

	"code.geniusai.org/notebook-manager/pkg/resource"
)

func TestValidateSuccess_test(t *testing.T) {
	notebookStoreMock := &NotebookStoreMock{}
	resourceManager := resource.NewStoreManager(notebookStoreMock)
	exist := resourceManager.CheckNotebookNameIfExist("existNotebookName", "existUserID")
	if !exist {
		t.Fatalf("结果不符合预期")
	}
}

func TestValidateFailed_test(t *testing.T) {
	notebookStoreMock := &NotebookStoreMock{}
	resourceManager := resource.NewStoreManager(notebookStoreMock)
	exist := resourceManager.CheckNotebookNameIfExist("noExistNotebookName", "existUserID")
	if exist {
		t.Fatalf("结果不符合预期")
	}
}
